//
//  MyAddressViewController.m
//  NewProject
//
//  Created by admin on 2017/6/22.
//  Copyright © 2017年 李航飞. All rights reserved.
//

#import "MyAddressViewController.h"
#import "MyAddressTableViewCell.h"
@interface MyAddressViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic,strong) UILabel *biaoShiLab;
@end

@implementation MyAddressViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"我的地址";
    self.view.backgroundColor=LINE_COLOE_223;
    [self setUpView];
    // Do any additional setup after loading the view.
}
- (void)setUpView{
    
    
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, self.view.frame.size.width, self.view.frame.size.height-10-64) style:UITableViewStylePlain];
    //   _arr=[[NSMutableArray alloc] initWithObjects:@"和泰大厦",@"和泰大厦",@"和泰大厦",@"和泰大厦", @"和泰大厦",nil];
    //    arr=[@"和泰大厦",@"和泰大厦",@"和泰大厦",@"和泰大厦",nil];
    
    //    [tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    //去掉tableView自带分割线
//    tableView.separatorStyle =  UITableViewCellSeparatorStyleNone;
    tableView.dataSource = self;
    tableView.delegate = self;
    [self.view addSubview:tableView];
    _biaoShiLab =[[UILabel alloc] initWithFrame:CGRectMake(0, 10, 10*kScrenWidth, 80)];
    _biaoShiLab.backgroundColor=ALL_COLOR;
    [tableView addSubview:_biaoShiLab];
    
    UIView *diView=[[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-64-64, WIDTH, 64)];
    diView.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:diView];
    
    UIButton *addBtn=[[UIButton alloc] initWithFrame:CGRectMake(25*kScrenWidth, 12, WIDTH-50*kScrenWidth, 40)];
    [addBtn setTitle:@"+新增地址" forState:UIControlStateNormal];
    [addBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    addBtn.backgroundColor=ALL_COLOR;
    [diView addSubview:addBtn];
    
}
#pragma mark -- UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    _biaoShiLab.frame=CGRectMake(0, indexPath.row*100+10, 10*kScrenWidth, 80);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //    static NSString *myCellIdentifer = @"myCell";
    //    UITableViewCell *cell = nil;
    static NSString*iden=@"cell";
    MyAddressTableViewCell *cell=[[MyAddressTableViewCell alloc]initWithResueIdentifier:iden];
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    cell.nameLable.text=@"姓名";
    cell.telLable.text=@"13456789876";
    cell.addressLable.text=@"和泰大厦1108室";
//    cell.messageLabel.text=_arr[indexPath.row][@"name"];
    //    cell = [tableView dequeueReusableCellWithIdentifier:myCellIdentifer];
    //
    //
    //    if (!cell) {
    //        cell = [[DingWeiTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:myCellIdentifer];
    //    }
    
    return cell;
}


#pragma marl -- UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
